package org.taofuxn.framework.ui.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.view.View;

import com.taofuxn.yycreazy.R;

/**
 * toolbar 和mvp结合
 * Created by taofuxn on 2016/9/23.
 */
public abstract class MvpToobarActivity extends MvpActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ((Toolbar) findViewById(R.id.toolbar)).setNavigationIcon(R.mipmap.abc_ic_ab_back_mtrl_am_alpha);
        ((Toolbar) findViewById(R.id.toolbar)).setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                todoBeforeFinish();
            }
        });
    }

    /**
     * 返回键处理
     */
    protected abstract void todoBeforeFinish();
}
